home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Developer Helper 1: Phil & Dave's Excellent CD
/
Excellent CD HFS.raw
/
Moof
/
Goodies
/
MPW Goodies
/
MPW Goodies⁄DTS
/
MountServer
< prev
next >
Wrap
Text File
|
2022-08-05
|
1KB
|
54 lines
# MountServer - mount a server
#
# Usage: MountServer server
#
# Status: MountServer may return the following status values:
#
# 0 the server was mounted
# 1 error
# 4 the user canceled
#
# MountServer mounts a a server volume.
# If the volume is not already mounted,
# it asks for a password for the volume.
#
# © Apple Computer, Inc. 1988
# All rights reserved.
Set Exit 0
Begin
Set Server "{1}"
# make sure that names are formed properly
If "{Server}" =~ /([¬:]*)®1:([¬:]+)®2:«0,1»/
Set Zone "*"
Set Server "{®1}"
Set Volume "{®2}"
Else If "{Server}" =~ /([¬:]*)®1:([¬:]+)®2:([¬:]+)®3:«0,1»/
Set Zone "{®1}"
Set Server "{®2}"
Set Volume "{®3}"
Else
Exit 1
End
# check if the volume is mounted
If `Exists "{Volume}:"` == ""
# handle case where one volume from this server is already mounted (or empty password)
Choose "{Zone}:{Server}:{Volume}" ≥ Dev:Null
If {Status} ≠ 0
Set IgnoreCmdPeriod 1
Set Password "`CoolRequest -h -p "Enter your password on the “{Server}” server, please:"; Set GetPasswordStatus {Status}`"
Set IgnoreCmdPeriod 0
Exit 4 If {GetPasswordStatus} == 4
Exit 1 If {GetPasswordStatus} ≠ 0
Choose "{Zone}:{Server}:{Volume}" -pw "{Password}"
Unset Password
Exit 1 If {Status} ≠ 0
End
End
End ∑ Dev:Null